# calculator计算器
while True:
    print("这是一个简易计算器,若输入q自动退出")
    num1 = input("请输入一个数字number1: " ) 
    operator = input("请输入四种操作符（+ - * /）中任选其一: " )
    num2 = input("请再次输入一个数字number2: " )
    if num1 == 'q' or operator == 'q' or num2 == 'q':
        print('您输入了q,本程序退出,再见')
        break
    n1 = int(num1)    
    n2 = int(num2)
    if operator == '+':
        result = n1 + n2
    elif operator == '-':
        result = n1 - n2
    elif operator == '*':
        result = n1 * n2
    elif operator == '/':
        result = n1 / n2
    else:
        result = f"操作符输入错误，请重新输入"
    print("计算结果是: ", result, f"\n")